// 图层目录树
const LayerTree = new Zondy.Service.GetMapInfoService({
  ip: "localhost",
  port: 6163,
  mapName: "guang01",
});

//获取地图文档信息
LayerTree.GetMapInfo(function (data) {
  console.log(data);

  // 获取地图信息
  const docCatalog = new Zondy.Catalog.MapDoc({
    ip: "localhost",
    port: 6163,
    docName: "guang01",
  });
  docCatalog.getMapDocInfo(function (data) {
    console.log(data);

    // 获取指定地图下所有图层的要素信息
    docCatalog.getLayersInfo(function (data) {
      // 获取要素名字和要素类型
      // console.log(data)
      let layerName = data.value.map((item) => {
        return [item.Name, item.GeomType];
      });

      layerName.forEach(function (value, index, arr) {});
    });
  });
});

// 目录树的显示隐藏
function containerLeftToggle() {}

// 目录条目折叠
function catalogFold(obj) {}

// 图层显示隐藏
function layerToggle(e, index) {
  // console.dir(e)
  // console.log(index)
  e.checked
    ? docLayer.setLayerStatus(index, "include")
    : docLayer.setLayerStatus(index, "exclude");
}

export { LayerTree };
